<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $cfg_webname; ?>- 会员注册</title>
<link href="../../img/css.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../../img/js/all.js"></script>
<script language="javascript" src="../../img/js/cookie.js"></script>
<script language="javascript" src="../../img/js/login.js"></script>
<script language="javascript" > 
HtmlInitFuc(function(){InitForm( "formReg" , "inputa_hover" );});
 
var mobileOK = false;
var emailOk = false;
function doCheckMobile(){ 
	var mobileString = $("mobile").value;
	if( !egrMobileCheck(mobileString) ){
		$("mobileMsg").innerHTML='请正确输入您的手机号码。';
		$("mobileMsg").className='divts';
		$("moblieIco").src='../../img/no1.gif';
		$("moblieIco").style.display='';
		mobileOK=false;
		return false;
	}
	returnFuc = function(text){
		if(text=="0"){
			$("mobileMsg").innerHTML='您输入的手机可以使用。';
			$("mobileMsg").className='';
			$("moblieIco").src='../../img/yes1.gif';
			$("moblieIco").style.display='';
			mobileOK=true;
			return true;
		}else{
			$("mobileMsg").innerHTML='该手机号码已经给注册了，请您重新输入。';
			$("mobileMsg").className='divts';
			$("moblieIco").src='../../img/no1.gif';
			$("moblieIco").style.display='';
			mobileOK=false;
			return false;
		}
	}
	axajSend( "CheckMobile.php?m=" +Math.random()+"&mobile="+mobileString, "GET", null , returnFuc );
	return;		
}
 
 
function doCheckMail(){ 
	var emailString = $("email").value;
	if( !checkMail(emailString) ){
		$("emailMsg").innerHTML='请输入正确的邮件格式。';
		$("emailMsg").className='divts';
		$("emailIco").src='../../img/no1.gif';
		$("emailIco").style.display='';
		emailOk=false;
		return false;
	}
	
	returnFuc = function(text){
		if(text=="0"){
			$("emailMsg").innerHTML='您输入的邮箱可以使用';
			$("emailMsg").className='';
			$("emailIco").src='../../img/yes1.gif';
			$("emailIco").style.display='';
			emailOk=true;
			return true;
		}else{
			$("emailMsg").innerHTML='该邮箱已经给注册了。';
			$("emailMsg").className='divts';
			$("emailIco").src='../../img/no1.gif';
			$("emailIco").style.display='';
			emailOk=false;
			return false;
		}
	}
	axajSend( "CheckEmail.php?m=" +Math.random()+"&email="+emailString, "GET", null , returnFuc );
	return;		
}
 
function checkPasswd()
{
	if( $("passwd").value == "" || $("passwd").value.length<4){
		$("passwdMsg").innerHTML='请输入您的密码，密码是4－14之间的字符。';
		$("passwdMsg").className='divts';
		$("passwdIco").src='../../img/no1.gif';
		$("passwdIco").style.display='';
		return false;
	}
	$("passwdMsg").innerHTML='&nbsp;';
	$("passwdMsg").className='';
	$("passwdIco").src='../../img/yes1.gif';
	$("passwdIco").style.display='';
 	return true; //暂时未加
}
 
 
function checkPasswdag()
{
	if(!checkPasswd()){
		return false;
	}
	if($("passwdag").value==""){
		$("passwdagMsg").innerHTML='请您再一次输入密码。';
		$("passwdagMsg").className='divts';
		$("passwdagIco").src='../../img/no1.gif';
		$("passwdagIco").style.display='';
		return false;
	}	
	if($("passwd").value!=$("passwdag").value){
		$("passwdagMsg").innerHTML='两次密码输入不同，请您再一次输入密码。';
		$("passwdagMsg").className='divts';
		$("passwdagIco").src='../../img/no1.gif';
		$("passwdagIco").style.display='';
		return false;
	}
	$("passwdagMsg").innerHTML='&nbsp;';
	$("passwdagMsg").className='';
	$("passwdagIco").src='../../img/yes1.gif';
	$("passwdagIco").style.display='';
 	return true; //暂时未加
}


function checktjr()
{
	
	
	if($("tjr").value=="")
	{
		$("tjrMsg").className='';
			$("tjrIco").src='../../img/yes1.gif';
			$("tjrIco").style.display='';
		tjrr=true;
		return true;
	}
	else{ //如果不为空
	
	returnFuc = function(text)
	{	//判断返回
		if(text=="0"){
			$("tjrMsg").innerHTML='推荐人手机号码可用';
			$("tjrMsg").className='';
			$("tjrIco").src='../../img/yes1.gif';
			$("tjrIco").style.display='';
			tjrr=true;
			return true;
		}else{
			$("tjrMsg").innerHTML='推荐人手机号码错误，如果没有请留空';
			$("tjrMsg").className='divts';
			$("tjrIco").src='../../img/no1.gif';
			$("tjrIco").style.display='';
			tjrr=false;
			return false;
		}	
	}	
	var tjrString = $("tjr").value;
	axajSend( "Checktjr.php?m=" +Math.random()+"&tjr="+tjrString, "GET", null , returnFuc );	
	}
	
	
	
}
 
 
 
function doSubmit()
{
 
	if($("mobile").value==""){
		alert("请输入您的手机号码");
		$("mobile").focus();   
		return false;
	}
	if( !egrMobileCheck($("mobile").value) ){
		alert("请正确输入您的手机号码");
		$("mobile").focus();   
		return false;
	}	
	if(!mobileOK){
		alert("手机号码已经给注册了,请您重新输入。");
		$("mobile").focus();   
		return false;
	}	
	
	if($("email").value==""){
		alert("请输入您的邮箱地址");
		$("mobile").focus();   
		return false;
	}
	
	if( !checkMail($("email").value) ){
		alert("请正确输入您的邮箱地址");
		$("email").focus();   
	}
	
	if(!emailOk){
		alert("邮箱地址已经给注册了,请您重新输入。");
		$("email").focus();   
		return false;
	}
	
	if(!checkPasswd()){
		alert("密码是4－14之间的字符");
		$("passwd").value = "";
		$("passwdag").value = "";
		$("passwd").focus();   
		return false;
	}  
	if(!checkPasswdag()){
		alert("两次密码输入不同");
		$("passwd").value = "";
		$("passwdag").value = "";
		$("passwd").focus();    
		return false;
	}
	
	if(!tjrr){
		alert("推荐人手机号码错误");
		$("tjr").focus();   
		return false;
	}
	
	
	//验证码校验，是否填写
	obj=$("code");
	if(obj.value==""){
		alert("请输入验证码");
		obj.focus();
		return false;
	}  
	
	//协议校验，是否选择同意
	obj=document.getElementsByName("agree");
	if(obj.checked == false){
		alert("您必须接受<?php echo $cfg_webname; ?>协议，才能继续注册");
		return false; 
	}
	
	return true;
}
</script>
<script language="javascript" type="text/javascript" src="/include/dedeajax2.js"></script>
<script language="javascript" type="text/javascript">
function CheckLogin(){
	  var taget_obj = document.getElementById('_ajax_feedback');
	  myajax = new DedeAjax(taget_obj,false,false,'','','');
	  myajax.SendGet2("{dede:global.cfg_cmsurl/}/users/ajax_feedback.php");
	  DedeXHTTP = null;
}
function Check_head_Login(){
	  var taget_obj = document.getElementById('_Check_head_Login');
	  myajax = new DedeAjax(taget_obj,false,false,'','','');
	  myajax.SendGet2("{dede:global.cfg_cmsurl/}/users/ajax_head.php");
	  DedeXHTTP = null;
}
function CheckLogin_index(){
	  var taget_obj = document.getElementById('_login_index');
	  myajax = new DedeAjax(taget_obj,false,false,'','','');
	  myajax.SendGet2("{dede:global.cfg_cmsurl/}/users/ajax_index.php");
	  DedeXHTTP = null;
}
</script>
</head>
 
<body>
<!--Head-->
<?php
   pasterTempletDiy("default/head_index.htm");
?>
<!--Head_end-->
<!--Main-->
<div id="page">
<div id="login_border1">
  <div id="login_border2">
  <div id="login_border3">
    <h3>注册成为<?php echo $cfg_webname; ?>会员</h3>
    <div id="login_border4">
    <form action="reg.php" method="post" id="formReg" name="formReg" onsubmit="return doSubmit()">
    <input type="hidden" name="dopost" id="dopost"  value="regbase" />    
      <ul id="login_l">
      <li><span><em>*</em>手机号:</span><input name="mobile" id="mobile" type="text" class="inputa" maxlength="11" onblur="doCheckMobile();" /> <img src="/img/yes1.gif" width="16" height="16" id="moblieIco" style="display:none;" />
        <div id="mobileMsg">请填写有效手机号码，以便接收订单等通知，及时了解订单情况</div></li>  
      <li><span><em>*</em>邮 箱:</span><input name="email" id="email" type="text" class="inputa" onblur="doCheckMail()" maxlength="50" /> <img src="/img/no1.gif" width="16" height="16" id="emailIco" style="display:none;" />
      <div id="emailMsg">请输入有效的邮件地址，当密码遗失时凭此领取。</div></li>
      <li><span><em>*</em>密 码:</span><input  name="passwd" id="passwd" onblur="checkPasswd()"  type="password" class="inputa" maxlength="14" /> <img src="/img/yes1.gif" width="16" height="16" id="passwdIco" style="display:none;" />
      <div id="passwdMsg">不超过7个汉字，或14个字节（数字，字母和下划线）</div></li>
      <li><span><em>*</em>再次输入密码:</span><input name="passwdag" id="passwdag" onblur="checkPasswdag()" type="password" class="inputa"  maxlength="14" /> <img src="/img/yes1.gif" width="16" height="16" id="passwdagIco" style="display:none;" /><div id="passwdagMsg">请您再一次输入密码。</div></li>
      
      <li><span><em></em>邀请码:</span><input name="tjr" id="tjr" onblur="checktjr()" type="text" class="inputa"  maxlength="14" /> <img src="/img/yes1.gif" width="16" height="16" id="tjrIco" style="display:none;" /><div id="tjrMsg">您的推荐人可以获得一定的现金奖励<font color="#0066FF">必须填写已注册用户，如没有请留空</font></div></li>
      
      <li><span><em>*</em>验证码:</span><input type="text" class="inputa" style="width:85px;" maxlength="4" style="width: 50px; text-transform: uppercase;" id="vdcode" name="vdcode"/>
       <img id="vdimgck" align="absmiddle" onclick="this.src=this.src+'?'" style="cursor: pointer;" alt="看不清？点击更换" src="../include/vdimgck.php"/><div>&nbsp;</div>
        <div><input  name="agree" id="agree" type="checkbox" value="1" checked="checked"/> 我已阅读并接受<?php echo $cfg_webname; ?><a href="/about/protocol.shtml" target="_blank">会员协议</a>确认<br />
        <br />
        <input type="image" src="/img/bt1.jpg" width="114" height="39" /></div>
      </li>
      </ul>
      </form>
      <div id="login_r"><strong>为什么要注册<?php echo $cfg_webname; ?>会员</strong><br />1. 以便我们更好的为您服务<br />
2. 会员参加旅游，可以获赠<a href="/about/help.shtml#4" target="_blank">抵用券</a>，<br />     　 
以获得更多优惠。</div>
    </div>
  </div>
  </div>
</div>
 
</div>
<!--Main_end-->
<!--Footer-->

<?php
   pasterTempletDiy("default/footer.htm");
?>


<!--Footer_end-->
</body>
</html>
